let utils = data["utils"];
let STUtil = data["STUtil"];
let Node = data["Node"];
let SplayTree = data["SplayTree"];
let isInBbox = data["isInBbox"];
let getBboxOverlap = data["getBboxOverlap"];
let cmp = data["cmp"];
let crossProduct = data["crossProduct"];
let dotProduct = data["dotProduct"];
let compareVectorAngles = data["compareVectorAngles"];
let sineOfAngle = data["sineOfAngle"];
let cosineOfAngle = data["cosineOfAngle"];
let closestPoint = data["closestPoint"];
let horizontalIntersection = data["horizontalIntersection"];
let verticalIntersection = data["verticalIntersection"];
let intersection = data["intersection"];
let perpendicular = data["perpendicular"];
let rounder = data["rounder"];
let geomIn = data["geomIn"];
let geomOut = data["geomOut"];
let operation = data["operation"];
let Segment = data["Segment"];
let SweepEvent = data["SweepEvent"];
let SweepLine = data["SweepLine"];
console.log("12PolygonClipping_segment03_1");

utils.extend(Segment.prototype, { prevInResult: function () { return void 0 !== this._prevInResult ? this._prevInResult : (this.prev ? this.prev.isInResult() ? this._prevInResult = this.prev : this._prevInResult = this.prev.prevInResult() : this._prevInResult = null, this._prevInResult) }, beforeState: function () { if (void 0 !== this._beforeState) return this._beforeState; if (this.prev) { const seg = this.prev.consumedBy || this.prev; this._beforeState = seg.afterState() } else this._beforeState = { rings: [], windings: [], multiPolys: [] }; return this._beforeState }, afterState: function () { if (void 0 !== this._afterState) return this._afterState; const beforeState = this.beforeState(); this._afterState = { rings: beforeState.rings.slice(0), windings: beforeState.windings.slice(0), multiPolys: [] }; const ringsAfter = this._afterState.rings, windingsAfter = this._afterState.windings, mpsAfter = this._afterState.multiPolys; for (let i = 0, iMax = this.rings.length; i < iMax; i++) { const ring = this.rings[i], winding = this.windings[i], index = ringsAfter.indexOf(ring); -1 === index ? (ringsAfter.push(ring), windingsAfter.push(winding)) : windingsAfter[index] += winding } const polysAfter = [], polysExclude = []; for (let i = 0, iMax = ringsAfter.length; i < iMax; i++) { if (0 === windingsAfter[i]) continue; const ring = ringsAfter[i], poly = ring.poly; if (-1 === polysExclude.indexOf(poly)) if (ring.isExterior) polysAfter.push(poly); else { -1 === polysExclude.indexOf(poly) && polysExclude.push(poly); const index = polysAfter.indexOf(ring.poly); -1 !== index && polysAfter.splice(index, 1) } } for (let i = 0, iMax = polysAfter.length; i < iMax; i++) { const mp = polysAfter[i].multiPoly; -1 === mpsAfter.indexOf(mp) && mpsAfter.push(mp) } return this._afterState } });


return {
  "utils": utils,
  "STUtil": STUtil,
  "Node": Node,
  "SplayTree": SplayTree,
  "isInBbox": isInBbox,
  "getBboxOverlap": getBboxOverlap,
  "cmp": cmp,
  "crossProduct": crossProduct,
  "dotProduct": dotProduct,
  "compareVectorAngles": compareVectorAngles,
  // "length":length,
  "sineOfAngle": sineOfAngle,
  "cosineOfAngle": cosineOfAngle,
  "closestPoint": closestPoint,
  "horizontalIntersection": horizontalIntersection,
  "verticalIntersection": verticalIntersection,
  "intersection": intersection,
  "perpendicular": perpendicular,
  "rounder": rounder,
  "geomIn": geomIn,
  "geomOut": geomOut,
  "operation": operation,
  "Segment": Segment,
  "SweepEvent": SweepEvent,
  "SweepLine": SweepLine
}